package com.yangzc.lion.sys.util.common;

import java.util.Locale;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.context.request.ServletWebRequest;

/**
 * WebContext工具类实现类（STRUTS2实现方式）
 * 
 */
public class ContextUtilImpl extends ContextUtil {

	public HttpServletRequest requestHook() {
		return ((ServletRequestAttributes) RequestContextHolder
				.getRequestAttributes()).getRequest();
	}

	public HttpServletResponse responseHook() {
		return ((ServletWebRequest) RequestContextHolder.getRequestAttributes())
				.getResponse();
	}

	public ServletContext contextHook() {
		return requestHook().getSession().getServletContext();
	}

	@Override
	public void setLocale(Locale locale) {
		// TODO Auto-generated method stub

	}

}
